import java.util.HashSet;
import java.util.TreeSet;

public class HaSet {
    public static void main(String[] args) {
        HashSet<String> set = new HashSet<String>();
        set.add("ad");
        set.add("bb");
        set.add("cc");

        set.forEach(o-> System.out.println(o));
        TreeSet s =  new TreeSet();
        s.add(2);
        s.add(3);
        s.add(5);
        System.out.println("1："+s.first());
        System.out.println(s.last());
        System.out.println(s.lower(3));
        System.out.println(s.floor(6));
        System.out.println(s.higher(4));
        System.out.println(s.ceiling(2));
        System.out.println(s.pollFirst());
        System.out.println(s.pollLast());


    }
}
